package com.olclass.web.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

@Entity
@Table(name = "lessonitem" )
public class Lessonitem  implements Serializable {

  private static final long serialVersionUID =  4791760347567669339L;

  @Id
  @GenericGenerator(name="idGenerator", strategy="uuid2")
  @GeneratedValue(generator="idGenerator")
  @Column(name = "id" )
  private String id;

  @Column(name = "description" )
  private String description;

  @Column(name = "name" )
  private String name;

  @Column(name = "pid" )
  private String pid;

  @Column(name = "date")
  private Date date;

  @OneToMany(fetch= FetchType.EAGER)
  @JoinColumn(name = "lessonid", insertable = false, updatable = false)
  @NotFound(action = NotFoundAction.IGNORE)
  private List<Lessonmedia> lessonmedias;

  public Date getDate() {
    return date;
  }

  public void setDate(Date date) {
    this.date = date;
  }

  public List<Lessonmedia> getLessonmedias() {
    return lessonmedias;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public void setLessonmedias(List<Lessonmedia> lessonmedias) {
    this.lessonmedias = lessonmedias;
  }

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public String getPid() {
    return pid;
  }

  public void setPid(String pid) {
    this.pid = pid;
  }

}
